import json

data = {
    "person": json.load(open("data\\person.json"))
    }

class timer(object):
    def __init__(self):
        pass
    def get_time(self, year, month, day, hour, minute, second):
        self.year = int(year)
        self.month = int(month)
        self.day = int(day)
        self.hour = int(hour)
        self.minute = int(minute)
        self.second = int(second)
        self.time_list = [self.year, self.month, self.day, self.hour, self.minute, self.second]
    def get_time_by_list(self, time_list: list):
        self.year = int(time_list[0])
        self.month = int(time_list[1])
        self.day = int(time_list[2])
        self.hour = int(time_list[3])
        self.minute = int(time_list[4])
        self.second = int(time_list[5])
        self.time_list = [self.year, self.month, self.day, self.hour, self.minute, self.second]
    def return_time(self):
        if self.time_list != None:
            return f"{self.year}年{self.month}月{self.day}日 {self.hour}时{self.minute}分{self.second}秒"
        else:
            return ""

class person(object):
    def __init__(self):
        pass
    def get_name(self, name: str):
        self.name = name
    def get_data(self, data):
        self.data = data
    def get_data_auto(self):
        self.data = data["person"]["data"][self.name]
    def return_data(self):
        return self.data
    def run_action(self, action: str,vaule = "<auto>", timer = timer()):
        if vaule == "<auto>":
            vaule = self.data["action"][action]["vaule"]
        if action == "say":
            print(f"{timer.return_time()} {self.name}说：“{vaule}”")

# print(data)
test = person()
test.get_name("test")
# test.get_data(data["person"]["data"]["test"])
test.get_data_auto()
# print(test.data)
timer = timer()
timer.get_time(0, 0, 0, 0, 0, 0)
test.run_action("say", "<auto>", timer)